/* RMI-C STUBS CLIENT & SERVER (V1) */
/* This file should be generated automatically... */

#include "rmi.h"
#include <rpc/xdr.h>

#define __echo__ 10000
#define __echo_hello__ 10001
#define __echo_goodbye__ 10002
#define __echo_sum__ 10003

/* ****************** COMMON STUBS ****************** */

struct two_int_t
{
  int x;
  int y;
};

bool_t xdr_two_int(XDR *xdrs, struct two_int_t * two_int)
{
  return xdr_int(xdrs,&two_int->x) && xdr_int(xdrs,&two_int->y);
}

struct echo_t; /* to be implemented by server */

/* ****************** CLIENT STUBS ****************** */

void echo_hello(CLIENT * client, void * in, void * out)
{
  rmi_client_call(client, __echo_hello__, 
		  (xdrproc_t)xdr_void, in, 
		  (xdrproc_t)xdr_wrapstring, out);
}

void echo_goodbye(CLIENT * client, void * in, void * out)
{
  rmi_client_call(client, __echo_goodbye__, 
		  (xdrproc_t)xdr_void, in, 
		  (xdrproc_t)xdr_void, out);
}

void echo_sum(CLIENT * client, void * in, void * out)
{
  rmi_client_call(client, __echo_sum__, 
		  (xdrproc_t)xdr_two_int, in, 
		  (xdrproc_t)xdr_int, out);
}

/* ****************** SERVER STUBS ****************** */

#ifdef RMI_SERVER

extern void echo_hello_(void* this, void* in, void* out);
extern void echo_goodbye_(void* this, void* in, void* out);
extern void echo_sum_(void* this, void* in, void* out);

void rmi_server_register_interface_echo(SERVER * server)
{
  rmi_server_register_method(server, __echo__, __echo_hello__,
    (xdrproc_t)xdr_void, (xdrproc_t)xdr_wrapstring, echo_hello_);
  rmi_server_register_method(server, __echo__, __echo_goodbye__,
    (xdrproc_t)xdr_void, (xdrproc_t)xdr_void, echo_goodbye_);
  rmi_server_register_method(server, __echo__, __echo_sum__,
    (xdrproc_t)xdr_two_int, (xdrproc_t)xdr_int, echo_sum_);
}

#endif

/* EOF */
